package cn.edu.scujcc.customofsichuan;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;

import androidx.fragment.app.Fragment;

import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
public class explore extends Fragment implements View.OnClickListener{

    private Context context;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        context=container.getContext();
        View root=inflater.inflate(R.layout.fragment_explore, container, false);
        View hbj_smallcard=root.findViewById(R.id.hbj_smallcard);
        View fdmh_smallcard=root.findViewById(R.id.fdmh_smallcard);
        View rdj_smallcard=root.findViewById(R.id.rdj_smallcard);
        View ezj_smallcard=root.findViewById(R.id.ezj_smallcard);
        View zsh_smallcard=root.findViewById(R.id.zsh_smallcard);
        View fsj_smallcard=root.findViewById(R.id.fsj_smallcard);
        View dfj_smallcard=root.findViewById(R.id.dfj_smallcard);

        hbj_smallcard.setOnClickListener(this);
        fdmh_smallcard.setOnClickListener(this);
        rdj_smallcard.setOnClickListener(this);
        ezj_smallcard.setOnClickListener(this);
        zsh_smallcard.setOnClickListener(this);
        fsj_smallcard.setOnClickListener(this);
        dfj_smallcard.setOnClickListener(this);
        return root;
    }

    @Override
    public void onClick(View view) {
        Intent intent=new Intent(context, explore_Detail.class);
        Bundle bundle=new Bundle();
        switch (view.getId()){
            case R.id.hbj_smallcard:
                bundle.putString("title","火把节指南");
                bundle.putString("webUrl","file:///android_asset/explore_hbj.html");
                intent.putExtras(bundle);
                startActivity(intent);
                break;
            case R.id.fdmh_smallcard:
                bundle.putString("title","丰都庙会指南");
                bundle.putString("webUrl","file:///android_asset/explore_fdmh.html");
                intent.putExtras(bundle);
                startActivity(intent);
                break;
            case R.id.rdj_smallcard:
                bundle.putString("title","燃灯节指南");
                bundle.putString("webUrl","file:///android_asset/explore_rdj.html");
                intent.putExtras(bundle);
                startActivity(intent);
                break;
            case R.id.ezj_smallcard:
                bundle.putString("title","瓦尔俄足节指南");
                bundle.putString("webUrl","file:///android_asset/explore_ezj.html");
                intent.putExtras(bundle);
                startActivity(intent);
                break;
            case R.id.zsh_smallcard:
                bundle.putString("title","转山会指南");
                bundle.putString("webUrl","file:///android_asset/explore_zsh.html");
                intent.putExtras(bundle);
                startActivity(intent);
                break;
            case R.id.fsj_smallcard:
                bundle.putString("title","放水节指南");
                bundle.putString("webUrl","file:///android_asset/explore_fsj.html");
                intent.putExtras(bundle);
                startActivity(intent);
                break;
            case R.id.dfj_smallcard:
                bundle.putString("title","大佛节指南");
                bundle.putString("webUrl","file:///android_asset/explore_dfj.html");
                intent.putExtras(bundle);
                startActivity(intent);
                break;
        }


    }
}